Main ----- Copyright Up -------- ----

Macro/tag attributes

Attributes are compareable to function arguments in programming languages like Pascal, Oberon or E. So attributes are arguments passed to a tag or macro.

Additionally, you can create/update attributes using <$define> and <$let>.

Within <$macro>, <$define> and <$deftag>, an attribute is defined with

name ":" type [ "/" flag ] [ "=" default value ]

Attribute types

STRING
any text
URI
references to an URI. Is affected bye command line options like STRIPEXTERNAL.
BOOL
boolean flag
ENUM
enumerator type; accepts only given values (eg the ALIGN attribute of <IMG>).
ID
id for current position in document; can be refered with <A HREF="#id">
NUM
decimal integer value
COLOR
a color-value of the template "#rrggbb" (used by some jerk-tags)

Attribute flags

/CONST (short: /C)
Attribute is read-only; you can't set a new value using <$let>. This flag is only allowed within <$define>
/GLOBAL (short: /G)
Attribute is global. Useful if you want to define an attribute inside a macro, that is not removed after macro has been processed. This flag is only allowed within <$define>.
/JERK (short: /J)
Attribute is only used by a jerk.
/REQUIRED (short: /R)
Attribute must be set when macro/tag is called.
Within <$macro> and <$deftag>, URIs also can have the following flags:
/SIZE (short: /Z)
If the attribute references to a local file, try to evaluate the "size" of the file, search for attributes called WIDTH and HEIGHT within the same tag and set them with these values (if they have not been set before). At they moment, only tags like <IMG> support this.
/STRIPEXT (short: /X)
Strip whole tag, if the attribute references to an external URI and option STRIPEXTERNAL has been enabled.

Default value

The default value initialises the attribute every time the macro is called. If the attribute is not set within the macro call, the default value is used. Otherwise, the value passed to the macro will be used as new value.

Examples

DO_IT:bool
defines a boolean attribute
UP:uri=":main.html"
defines an URI attribute and sets it's default value to ":main.html". The ":" indicates that the default value is an absolute URI.
MODE:enum("ascii|bin|hex")
defines an enumerator type; legal values are ascii, bin and hex.

Thomas Aglassinger ( agi@giga.or.at ), 15-May-1996